package cn.edu.ctbu.datajpa01.api;

import cn.edu.ctbu.datajpa01.core.RUtil;
import cn.edu.ctbu.datajpa01.domain.Student;
import cn.edu.ctbu.datajpa01.service.StudentService;
import cn.edu.ctbu.datajpa01.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/api/login")
public class LoginApiController {
    @Autowired
    private StudentService studentService;
//    @GetMapping("/student")
//    public R student(String name, String password, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)throws Exception{
////        Student student=studentService.findByNameAndPassword1(name,password);
////        HttpSession session=httpServletRequest.getSession();
////        session.setAttribute("user_name",student.getName());
////        session.setAttribute("password",student.getPassword());
////        return RUtil.success(student);
//    }
}
